package Model;
// Generated Dec 2, 2012 9:07:08 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * CrumbsCatalogOfWork generated by hbm2java
 */
@Entity
@Table(name="CRUMBS_CATALOG_OF_WORK"
    ,schema="NETCRACKER"
)
public class CrumbsCatalogOfWork  implements java.io.Serializable {


     private int id;
     private CrumbsCatalogOfWork crumbsCatalogOfWork;
     private String workDescription;
     private Integer runtime;
     private boolean isParent;
     private String workname;
     private Set<CrumbsCatalogOfWork> crumbsCatalogOfWorks = new HashSet<CrumbsCatalogOfWork>(0);
     private Set<CrumbsCatalogOfTools> crumbsCatalogOfToolses = new HashSet<CrumbsCatalogOfTools>(0);

    public CrumbsCatalogOfWork() {
    }

	
    public CrumbsCatalogOfWork(int id, boolean isParent, String workname) {
        this.id = id;
        this.isParent = isParent;
        this.workname = workname;
    }
    public CrumbsCatalogOfWork(int id, CrumbsCatalogOfWork crumbsCatalogOfWork, String workDescription, Integer runtime, boolean isParent, String workname, Set<CrumbsCatalogOfWork> crumbsCatalogOfWorks, Set<CrumbsCatalogOfTools> crumbsCatalogOfToolses) {
       this.id = id;
       this.crumbsCatalogOfWork = crumbsCatalogOfWork;
       this.workDescription = workDescription;
       this.runtime = runtime;
       this.isParent = isParent;
       this.workname = workname;
       this.crumbsCatalogOfWorks = crumbsCatalogOfWorks;
       this.crumbsCatalogOfToolses = crumbsCatalogOfToolses;
    }
   
     @Id 
    
    @Column(name="ID", unique=true, nullable=false, precision=9, scale=0)
    public int getId() {
        return this.id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PARENT_ID")
    public CrumbsCatalogOfWork getCrumbsCatalogOfWork() {
        return this.crumbsCatalogOfWork;
    }
    
    public void setCrumbsCatalogOfWork(CrumbsCatalogOfWork crumbsCatalogOfWork) {
        this.crumbsCatalogOfWork = crumbsCatalogOfWork;
    }
    
    @Column(name="WORK_DESCRIPTION", length=1000)
    public String getWorkDescription() {
        return this.workDescription;
    }
    
    public void setWorkDescription(String workDescription) {
        this.workDescription = workDescription;
    }
    
    @Column(name="RUNTIME", precision=9, scale=0)
    public Integer getRuntime() {
        return this.runtime;
    }
    
    public void setRuntime(Integer runtime) {
        this.runtime = runtime;
    }
    
    @Column(name="IS_PARENT", nullable=false, precision=1, scale=0)
    public boolean isIsParent() {
        return this.isParent;
    }
    
    public void setIsParent(boolean isParent) {
        this.isParent = isParent;
    }
    
    @Column(name="WORKNAME", nullable=false, length=40)
    public String getWorkname() {
        return this.workname;
    }
    
    public void setWorkname(String workname) {
        this.workname = workname;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="crumbsCatalogOfWork")
    public Set<CrumbsCatalogOfWork> getCrumbsCatalogOfWorks() {
        return this.crumbsCatalogOfWorks;
    }
    
    public void setCrumbsCatalogOfWorks(Set<CrumbsCatalogOfWork> crumbsCatalogOfWorks) {
        this.crumbsCatalogOfWorks = crumbsCatalogOfWorks;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="CRUMBS_WORK_AND_TOOLS", schema="NETCRACKER", joinColumns = { 
        @JoinColumn(name="WORK_ID", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="TOOL_ID", nullable=false, updatable=false) })
    public Set<CrumbsCatalogOfTools> getCrumbsCatalogOfToolses() {
        return this.crumbsCatalogOfToolses;
    }
    
    public void setCrumbsCatalogOfToolses(Set<CrumbsCatalogOfTools> crumbsCatalogOfToolses) {
        this.crumbsCatalogOfToolses = crumbsCatalogOfToolses;
    }




}


